package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.NursingLevelDto;
import com.zzyl.dto.NursingLevelPageQueryDto;
import com.zzyl.entity.NursingLevel;
import com.zzyl.vo.NursingLevelVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NursingLevelMapper {
    /**
     * 获取护理计划的次数
     * @param id
     * @return
     */
    @Select("select count(*) count from nursing_level where plan_id = #{id}")
    Integer getPlanCount(Long id);

    /**
     * 根据护理计划Id 查询 护理等级
     * @param id
     * @return
     */
    @Select("select * from nursing_level where plan_id = #{id}")
    NursingLevel getByPlanId(Long id);


    /**
     * 分页查询护理等级信息
     * @return
     */
    Page<NursingLevel> pageBean(NursingLevelPageQueryDto dto);

    void insert(NursingLevel nursingLevel);

    NursingLevelVo getById(Long id);

    void update(NursingLevel nursingLevel);

    @Delete("delete from nursing_level where id = #{id}")
    void delete(Long id);
    /**
     * 查询所有护理等级信息
     */
    List<NursingLevelVo> getAll();
}
